<!DOCTYPE html>
<html>
  <head>    
      <title>DKP列表</title>
      <% include layout/lib.ejs %>
      <link rel="stylesheet" type="text/css" href="/css/dkpIndex.css" />
  </head>
  <body>
    <div class="pageTitleBox">
      <span id="nowTeam"></span> / DKP列表
    </div>
    <div class="dkpActionBox">
      <i class="fa fa-search fa-lg"></i>
      <input placeholder="请输入要搜索的角色名称" id="dkpName" />
    </div>
    <div class="dkpBox">
      <div class="dkpItem" style="background:#f5f7f9;font-weight: 500;">
        <div class="dkpItemNoTitle">序号</div>
        <div class="dkpItemProfessionTitle">
          职业
        </div>
        <div class="dkpItemNameTitle">角色名称</div>
        <div class="dkpItemScoreTitle">DKP积分</div>
        <div class="dkpItemOtherTitle">
          操作
        </div>
      </div>
      <% for(var i=0;i<memberData.length;i++){ %>
      <div class="dkpItem dkpFilter">
        <div class="dkpItemNo"><%- (i+1) %></div>
        <div class="dkpItemProfession">
          <% if(memberData[i].m_profession == 0){ %>
            <img src="/image/dkp_6.png" />
            <% }else if(memberData[i].m_profession == 1){ %>
            <img src="/image/dkp_7.png" />
            <% }else if(memberData[i].m_profession == 2){ %>
            <img src="/image/dkp_8.png" />
            <% }else if(memberData[i].m_profession == 3){ %>
            <img src="/image/dkp_9.png" />
            <% }else if(memberData[i].m_profession == 4){ %>
            <img src="/image/dkp_10.png" />
            <% }else if(memberData[i].m_profession == 5){ %>
            <img src="/image/dkp_11.png" />
            <% }else if(memberData[i].m_profession == 6){ %>
            <img src="/image/dkp_12.png" />
            <% }else if(memberData[i].m_profession == 7){ %>
            <img src="/image/dkp_16.png" />
            <% } %>
        </div>
        <div class="dkpItemName"><%- memberData[i].m_name %></div>
        <div class="dkpItemScore"><%- memberData[i].m_integral %></div>
        <div class="dkpItemOther">
          <a href="/changeRecordIndex?mid=<%- memberData[i].m_id %>&name=<%- memberData[i].m_name %>"><i class="fa fa-pencil-square fa-lg" style="font-size:15px;position: relative;top:-1px;"></i>&nbsp;&nbsp;变动记录</a>
        </div>
      </div>
      <% } %>
      
    </div>
    
  </body>
</html>
<script>

  function getQueryVariable(variable){
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        for (var i=0;i<vars.length;i++) {
                var pair = vars[i].split("=");
                if(pair[0] == variable){return pair[1];}
        }
        return(false);
  }

  var teamValue = getQueryVariable("teamId");
  var teamName  = teamValue == 1 ? '黑翼团' : '安琪拉团';
  $("#nowTeam").html(teamName);

  $("#dkpName").change(function(){
    var filter = $(this).val();
    if(filter) {
      $matches = $(".dkpBox").find('.dkpFilter:Contains(' + filter + ')');
      $('.dkpFilter', $(".dkpBox")).not($matches).hide();
      $matches.show();
    }else{
      $('.dkpFilter').show();
    }
    
  })
</script>